/* eslint-disable */ //eslint意思是检查规范代码 
import layoutHeaderAside from '@/layout/header-aside'
import System from './modules/system';
import Product from './modules/product';
import Channel from './modules/channel';
import Supplier from './modules/supplier';
import Ueditor from './modules/ueditor';
import Sample from './modules/sample';
import MartUser from './modules/martUser';
import Platform from './modules/platform';
import Shop from './modules/shop';
import ShopCashierChangeShift from './modules/shopCashierChangeShift';
import shopForSelfOperation from './modules/shopForSelfOperation';
import Repository from './modules/repository';
import Order from './modules/order';
import Purchase from './modules/purchase';
import Coupon from './modules/coupon';
import Live from './modules/live';
import Marketing from './modules/marketing';

import StockOut from './modules/stockOut';
import StockIn from './modules/stockIn';
import Allocation from './modules/allocation';
import Stock from './modules/stock';
import profitAllocation from './modules/profitAllocation';

// 餐饮收银
import ResShop from './modules/restaurant/sys/resShop';
import ResConfig from './modules/restaurant/sys/resConfig';
import TempReport from './modules/restaurant/tempReport';
import ResOrder from './modules/restaurant/merchant/order';
import ResProduct from './modules/restaurant/merchant/product';
import resCashier from './modules/restaurant/merchant/resCashier';

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

/**
 * 在主框架内显示
 */
const frameIn = [
	{
		path: '/',
		redirect: {
			name: 'index'
		},
		component: layoutHeaderAside,
		children: [
			// 首页
			{
				path: 'index',
				name: 'index',
				meta: {
					auth: true
				},
				component: _import('system/index')
			},

			// 系统 前端日志
			{
				path: 'log',
				name: 'log',
				meta: {
					title: '前端日志',
					auth: true
				},
				component: _import('system/log')
			},
			// 刷新页面 必须保留
			{
				path: 'refresh',
				name: 'refresh',
				hidden: true,
				component: _import('system/function/refresh')
			},
			// 页面重定向 必须保留
			{
				path: 'redirect/:route*',
				name: 'redirect',
				hidden: true,
				component: _import('system/function/redirect')
			},
		]
	},
	
	System,
	Product,
	Channel,
	Supplier,
	Ueditor,
	Sample,
	MartUser,
	Platform,
	Shop,
	ShopCashierChangeShift,
	shopForSelfOperation,
	Repository,
	Order,
	Coupon,
	Live,
	Marketing,
	Purchase,
	StockOut,
	StockIn,
	Allocation,
	Stock,
	profitAllocation,

	// 餐饮收银
	TempReport,
	ResOrder,
	ResProduct,
	ResShop,
	resCashier,
	ResConfig
]

/**
 * 在主框架之外显示
 */
const frameOut = [
	// 登录
	{
		path: '/login',
		name: 'login',
		component: _import('system/login')
	},
	// 小程序调用
	{
		path: '/weixin',
		name: 'weixin',
		component: _import('weixin/getOpenId')
	}
]

/**
 * 错误页面
 */
const errorPage = [{
	path: '*',
	name: '404',
	component: _import('system/error/404')
}]

// 导出需要显示菜单的
export const frameInRoutes = frameIn

// 重新组织后导出
export default [
	...frameIn,
	...frameOut,
	...errorPage
]